package com.chuiyuan;

import com.chuiyuan.entity.Poem;

/**
 * Created by chuiyuan on 2/21/16.
 */
public class DetailsTask implements Runnable {
    private String url ;
    private Poem poem ;
    private HttpService httpService ;
    private ProcessDoc processDoc ;
    public DetailsTask(String url ){
        this.url = url ;
    }

    public DetailsTask(Poem poem, HttpService httpService, ProcessDoc processDoc){
        this.poem = poem;
        this.httpService = httpService;
        this.processDoc = processDoc;
    }

    public void run() {
        processDoc.processDetails(poem,httpService);
        System.out.println("thread "+ Thread.currentThread().getName()+
        ":"+poem.getTitle());
    }
}
